/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.feriaderemates.dao.listing;

import com.feriaderemates.domain.message.Message;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

/**
 *
 * @author Lenovo
 */
public class MessagingRowMapper implements RowMapper {

    public Object mapRow(ResultSet rs, int i) throws SQLException {
       return Message.createMessageToShow(rs.getString("sender_username"),
                rs.getString("receiver_username"), rs.getString("message"), 
                rs.getString("subject"), rs.getDate("date"));
    }
    
}
